<!DOCTYPE html>
<html>

<!-- Mirrored from /theme/hplus/form_builder.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:19 GMT -->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>乡土味士-自媒体后台管理中心 - Bootstrap3 表单构建器</title>
<meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
<meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">
<link rel="shortcut icon" href="favicon.ico">
<link href="__PUBLIC__/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
<link href="__PUBLIC__/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
<link href="__PUBLIC__/css/animate.min.css" rel="stylesheet">
<link href="__PUBLIC__/css/plugins/summernote/summernote.css" rel="stylesheet">
<link href="__PUBLIC__/css/plugins/summernote/summernote-bs3.css" rel="stylesheet">
<link href="__PUBLIC__/css/style.min862f.css?v=4.1.0" rel="stylesheet">
<style>
.droppable-active {
	background-color: #ffe!important
}
.tools a {
	cursor: pointer;
	font-size: 80%
}
.form-body .col-md-6, .form-body .col-md-12 {
	min-height: 400px
}
.draggable {
	cursor: move
}
</style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content">
  <div class="row">
    <div class="col-sm-12">
      <div class="ibox float-e-margins">
        <div class="ibox-content">
          <div class="row form-body form-horizontal m-t">
            <div class="col-md-6">
              <div class="form-group">
                <label class="col-sm-3 control-label">(一级)省：</label>
                <div class="col-sm-9">
                  <select class="form-control select-1" >
                  	<option value="0">请选择</option>
                  <volist name="areali" id="vo">
                  	<option value="{$vo.id}">{$vo.name}		编号:{$vo.area_id}（{$vo.id}）</option>
                  </volist>
                  </select>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">(二级)市：</label>
                <div class="col-sm-9">
                  <select class="form-control select-2" name="">
                  </select>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">(三级)区：</label>
                <div class="col-sm-9">
                  <select class="form-control select-3" name="">
                  </select>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">(四级)街道：</label>
                <div class="col-sm-9">
                  <select class="form-control select-4" name="">
                  </select>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">(五级)居委会/村：</label>
                <div class="col-sm-9">
                  <select class="form-control select-5" name="">
                  </select>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">当前地址：</label>
                <div class="col-sm-9">
                  <p class="form-control-static">这里是纯文字信息</p>
                </div>
              </div>
            </div>
            <div class="col-md-6">
            
              <div class="form-group">
                <label class="col-sm-3 control-label">ID：</label>
                <div class="col-sm-9">
                  <input type="text" name="id" class="form-control" placeholder="请输入文本">
                  <span class="help-block m-b-none">当前编辑ID，为空表示插入</span> </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">上级地区(ID)：</label>
                <div class="col-sm-9">
                  <input type="text" name="re_id" class="form-control" placeholder="请输入文本">
                  <span class="help-block m-b-none">默认0表示插入省会城市</span> </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">地区名称：</label>
                <div class="col-sm-9">
                  <input type="text" name="name" class="form-control" placeholder="请输入文本">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">地区编号：</label>
                <div class="col-sm-9">
                  <input type="text" name="area_id" class="form-control" placeholder="请输入文本">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">地区级别：</label>
                <div class="col-sm-9">
                  <input type="text" name="lev" class="form-control" placeholder="请输入文本">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-3 control-label">排序：</label>
                <div class="col-sm-9">
                  <input type="text" name="disorder" class="form-control" placeholder="请输入文本">
                  <span class="help-block m-b-none">默认0，可忽略</span> </div>
              </div>
              <div class="form-group">
                <div class="col-sm-12 col-sm-offset-3">
                  <button class="btn btn-primary" onClick="savearea();">保存内容</button>
                  <button class="btn btn-white" >取消</button>
                </div>
              </div>
              
            </div>
          </div>
          
        </div>
      </div>
    </div>
  </div>
</div>
<script src="__PUBLIC__/js/jquery.min.js?v=2.1.4"></script>
<script src="__PUBLIC__/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__PUBLIC__/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="__PUBLIC__/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__PUBLIC__/js/plugins/layer/layer.min.js"></script>
<script src="__PUBLIC__/js/hplus.min.js?v=4.1.0"></script>
<script type="text/javascript" src="__PUBLIC__/js/contabs.min.js"></script>
<script src="__PUBLIC__/js/plugins/pace/pace.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){
	//一级
  $(".select-1").change(function(){
	//获取下一级所有地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getnext/rid/"+$(".select-1").val(),
    async:false,
    success: function(data){
		//展示下一级地区
		var instr="<option value='0'>请选择</option>";
		for(var i=0;i<data.length;i++){
			instr+="<option value='"+data[i].id+"'>"+data[i].name+"		编号:"+data[i].area_id+"（"+data[i].id+"）"+"</option>";
			}//end for
		$(".select-2 option").remove();//移除所有option
		$(".select-3 option").remove();//移除所有option
		$(".select-4 option").remove();//移除所有option
		$(".select-5 option").remove();//移除所有option
		$(".select-2").append(instr);//添加新的option
    }
	});//end ajax
	//获取当前完整地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getinfo/id/"+$(".select-1").val(),
    async:false,
    success: function(data){
		//当前地址
		$(".form-control-static").text(data.nowadd);
		//右侧input
		$("input[name='id']").val(data[0].id);
		$("input[name='area_id']").val(data[0].area_id);
		$("input[name='name']").val(data[0].name);
		$("input[name='re_id']").val(data[0].re_id);
		$("input[name='lev']").val(data[0].lev);
		$("input[name='disorder']").val(data[0].disorder);
    }
	});//end ajax
  });//end change
  //二级
  $(".select-2").change(function(){
	//获取下一级所有地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getnext/rid/"+$(".select-2").val(),
    async:false,
    success: function(data){
		//展示下一级地区
		var instr="<option value='0'>请选择</option>";
		for(var i=0;i<data.length;i++){
			instr+="<option value='"+data[i].id+"'>"+data[i].name+"		编号:"+data[i].area_id+"（"+data[i].id+"）"+"</option>";
			}//end for
		$(".select-3 option").remove();//移除所有option
		$(".select-4 option").remove();//移除所有option
		$(".select-5 option").remove();//移除所有option
		$(".select-3").append(instr);//添加新的option
    }
	});//end ajax
	//获取当前完整地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getinfo/id/"+$(".select-2").val(),
    async:false,
    success: function(data){
		//当前地址
		$(".form-control-static").text(data.nowadd);
		//右侧input
		$("input[name='id']").val(data[0].id);
		$("input[name='area_id']").val(data[0].area_id);
		$("input[name='name']").val(data[0].name);
		$("input[name='re_id']").val(data[0].re_id);
		$("input[name='lev']").val(data[0].lev);
		$("input[name='disorder']").val(data[0].disorder);
    }
	});//end ajax
  });//end change
  //三级
  $(".select-3").change(function(){
	//获取下一级所有地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getnext/rid/"+$(".select-3").val(),
    async:false,
    success: function(data){
		//展示下一级地区
		var instr="<option value='0'>请选择</option>";
		for(var i=0;i<data.length;i++){
			instr+="<option value='"+data[i].id+"'>"+data[i].name+"		编号:"+data[i].area_id+"（"+data[i].id+"）"+"</option>";
			}//end for
		$(".select-4 option").remove();//移除所有option
		$(".select-5 option").remove();//移除所有option
		$(".select-4").append(instr);//添加新的option
    }
	});//end ajax
	//获取当前完整地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getinfo/id/"+$(".select-3").val(),
    async:false,
    success: function(data){
		//当前地址
		$(".form-control-static").text(data.nowadd);
		//右侧input
		$("input[name='id']").val(data[0].id);
		$("input[name='area_id']").val(data[0].area_id);
		$("input[name='name']").val(data[0].name);
		$("input[name='re_id']").val(data[0].re_id);
		$("input[name='lev']").val(data[0].lev);
		$("input[name='disorder']").val(data[0].disorder);
    }
	});//end ajax
  });//end change
  //四级
  $(".select-4").change(function(){
	//获取下一级所有地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getnext/rid/"+$(".select-4").val(),
    async:false,
    success: function(data){
		//展示下一级地区
		var instr="<option value='0'>请选择</option>";
		for(var i=0;i<data.length;i++){
			instr+="<option value='"+data[i].id+"'>"+data[i].name+"		编号:"+data[i].area_id+"（"+data[i].id+"）"+"</option>";
			}//end for
		$(".select-5 option").remove();//移除所有option
		$(".select-5").append(instr);//添加新的option
    }
	});//end ajax
	//获取当前完整地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getinfo/id/"+$(".select-4").val(),
    async:false,
    success: function(data){
		//当前地址
		$(".form-control-static").text(data.nowadd);
		//右侧input
		$("input[name='id']").val(data[0].id);
		$("input[name='area_id']").val(data[0].area_id);
		$("input[name='name']").val(data[0].name);
		$("input[name='re_id']").val(data[0].re_id);
		$("input[name='lev']").val(data[0].lev);
		$("input[name='disorder']").val(data[0].disorder);
    }
	});//end ajax
  });//end change
  //五级
  $(".select-5").change(function(){
	//获取下一级所有地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getnext/rid/"+$(".select-5").val(),
    async:false,
    success: function(data){
		//展示下一级地区
		var instr="<option value='0'>请选择</option>";
		for(var i=0;i<data.length;i++){
			instr+="<option value='"+data[i].id+"'>"+data[i].name+"		编号:"+data[i].area_id+"（"+data[i].id+"）"+"</option>";
			}//end for
		//$(".select-6 option").remove();//移除所有option
		//$(".select-6").append(instr);//添加新的option
    }
	});//end ajax
	//获取当前完整地址
    $.ajax({
    type : "POST",
    dataType : "json",
    url: "__MODULE__/Area/getinfo/id/"+$(".select-5").val(),
    async:false,
    success: function(data){
		//当前地址
		$(".form-control-static").text(data.nowadd);
		//右侧input
		$("input[name='id']").val(data[0].id);
		$("input[name='area_id']").val(data[0].area_id);
		$("input[name='name']").val(data[0].name);
		$("input[name='re_id']").val(data[0].re_id);
		$("input[name='lev']").val(data[0].lev);
		$("input[name='disorder']").val(data[0].disorder);
    }
	});//end ajax
  });//end change
  
});

function savearea(){
	//增加，更新地址
    $.ajax({
    type : "POST",
    dataType : "json",
	data:{id:$("input[name='id']").val(),area_id:$("input[name='area_id']").val(),name:$("input[name='name']").val(),re_id:$("input[name='re_id']").val(),lev:$("input[name='lev']").val(),disorder:$("input[name='disorder']").val()},
    url: "__MODULE__/Area/savearea/",
    async:false,
    success: function(data){
		alert(data);
    }
	});//end ajax
}//end fun
</script>
</body>

<!-- Mirrored from /theme/hplus/form_builder.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:20 GMT -->
</html>
